# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name： __init__.py
Description :
Author : 'li'
date： 2022/7/3
Change Activity:
2022/7/3:
-------------------------------------------------
"""
from ....common.design_pattern.register.register_factory import REGISTER_FACTORY
from .dab_transformer import DABTransformer

_registry_name = 'transformer'


def _build_registry():
    """
    build normal lay registry.

    """
    _register = REGISTER_FACTORY.create_registry(_registry_name)
    _register.add('DABTransformer', value=DABTransformer)


_build_registry()  # build when module load.


def build_transformer(cfg=None, callable_name=None):
    """
    build backbone

    Args:
        callable_name: module name
        cfg: must contain num_features;

    Returns:

    """
    return REGISTER_FACTORY.build_from_config(_registry_name, cfg, callable_name)
